package cn.dengta.webapp.user.model;

import cn.dengta.common.model.ValueProxy;
import cn.dengta.context.model.LabelI18nProxy;
import cn.dengta.context.model.UserEnumI18nKey;
import cn.dengta.webapp.user.entity.Moment;
import lombok.Getter;

/**
 * 关联类型
 */
@Getter
public enum AssocType implements LabelI18nProxy<AssocType, String> {

	/** 动态 */
	Moment(UserEnumI18nKey.ASSOC_TYPE_MOMENT, Moment.class),
	//
	;
	// 定义私有变量
	final ValueProxy<AssocType, String> proxy;
	final Class<?> clazz;

	AssocType(String label, Class<?> clazz) {
		this.clazz = clazz;
		this.proxy = new ValueProxy<>(this, this.name(), label);
	}

	public static AssocType[] getValues() {
		return ValueProxy.getCachedArray(AssocType.class, AssocType::values);
	}

	public static AssocType of(String type) {
		return Moment.getValueOf(type);
	}

}
